<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>订单详情</title>
<link rel="stylesheet" href="../../../component/pear/css/pear.css" />
</head>
<body class="pear-container">
	<div class="layui-card"></div>
	<div class="layui-card">
		<div class="layui-card-body">
			<table id="items-table" lay-filter="items-table"></table>
		</div>
	</div>

	<script type="text/html" id="goods-name">
			{{d.goodsname}}
		</script>

	<script src="../../../component/layui/layui.js"></script>
	<script src="../../../component/pear/pear.js"></script>
	<script>
		layui.use([ 'table', 'form', 'jquery', 'common' ], function() {
			let table = layui.table;
			let form = layui.form;
			let $ = layui.jquery;
			let common = layui.common;

			let MODULE_PATH = "operate/";

			let cols = [ [ {
				type : 'checkbox'
			}, {
				title : '详情编号',
				field : 'itemsid',
				align : 'center',
				width : 200
			}, {
				title : '订单编号',
				field : 'orderid',
				align : 'center',
				width : 200
			},{
				title : '总金额',
				field : 'cost',
				align : 'center'
			}, {
				title : '用户',
				field : 'username',
				align : 'center'
			}, {
				title : '商品名称',
				field : 'goodsname',
				align : 'center',
				templet : '#goods-name'

			} ] ]

			table.render({
				elem : '#items-table',
				url : '../../../../orderitems.do?orderid='
						+ localStorage.getItem("orderid"), //请求自己定义的后端接口
				page : true,
				cols : cols,
				skin : 'line',
				toolbar : '#user-toolbar',
				defaultToolbar : [ {
					title : '刷新',
					layEvent : 'refresh',
					icon : 'layui-icon-refresh',
				}, 'filter', 'print', 'exports' ]
			});


			window.refresh = function(param) {
				table.reload('items-table');
			}
		})
	</script>
</body>
</html>
